package com.custom.action.core.plugin;

import com.custom.action.interfaces.ExecuteHandler;

/**
 * @author XiaoBai
 * @since 2024/1/17 13:38
 */
public class Invocation {

    private final ExecuteHandler executeHandler;

    private final Object[] args;

    private final PluginExecutor executor;


    public Invocation(ExecuteHandler executeHandler, Object[] args, PluginExecutor executor) {
        this.executeHandler = executeHandler;
        this.args = args;
        this.executor = executor;
    }

    public ExecuteHandler getExecuteHandler() {
        return executeHandler;
    }

    public Object[] getArgs() {
        return args;
    }

    public PluginExecutor getExecutor() {
        return executor;
    }

    public Object proceed() throws Exception {
        return this.executor.doExecute();
    }
}
